package com.example.homecunter.news.newsviewmodel;

import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.MutableLiveData;

import com.example.common.utils.BaseEntity;
import com.example.homecunter.news.newsentity.NewsEntity;
import com.example.homecunter.news.newsentity.NewsType;
import com.example.homecunter.news.newsrepository.NewsRepository;
import com.example.homecunter.video.entity.ChannelEntity;
import com.example.mvvmcore.viewmodel.BaseViewModel;

import java.util.List;

public class NewsViewModel extends BaseViewModel<NewsRepository> {


    public NewsViewModel(LifecycleOwner _owner) {
        super(_owner);
    }

    @Override
    protected void releaseResource() {

    }

    @Override
    protected void initResource() {

    }

    @Override
    protected NewsRepository createRepository() {
        return new NewsRepository();
    }

    public MutableLiveData<BaseEntity<List<NewsType>>> getTypt(){
        return mRepository.getType();
    }

    public MutableLiveData<BaseEntity<List<NewsEntity>>> getNews(int newstype,int page){
        return mRepository.newsData(newstype,page);
    }
}
